# !/usr/bin/env python
# -*- coding: UTF-8 -*-
# -------------------------------------------------------------------
import properties

# -----------------------------------------------------------------------------
# Configuración
# -----------------------------------------------------------------------------
DEBUG = getattr(properties, 'debug', True)
TEMPLATE_DEBUG = getattr(properties,'template_debug', True)
SITE_ROOT= getattr(properties, 'site_root', "http://localhost:8000/")
MANAGERS = getattr(properties, 'managers', ())
USE_ADMIN = False
# -----------------------------------------------------------------------------
# Base de datos
# -----------------------------------------------------------------------------
DATABASE_ENGINE = getattr(properties, 'database_engine', 'sqlite3')  
DATABASE_NAME = getattr(properties, 'database_name', 'db.sqlite')     
DATABASE_USER = getattr(properties, 'database_user', None)            
DATABASE_PASSWORD = getattr(properties, 'database_password', '')      
DATABASE_HOST = getattr(properties, 'database_host','')               
DATABASE_PORT = getattr(properties, 'database_port','')               
# -----------------------------------------------------------------------------
# urls
# -----------------------------------------------------------------------------
ROOT_URLCONF = 'urls'
MEDIA_ROOT = getattr(properties, 'media_root', '.')
MEDIA_URL = getattr(properties, 'media_url','http://localhost:8000/media/')
ADMIN_MEDIA_PREFIX = getattr(properties, 'admin_media_prefix','/adm_media/')
# -----------------------------------------------------------------------------
# cache and session
# -----------------------------------------------------------------------------
CACHE_BACKEND=getattr(properties, 'cache_backend','dummy:///')
CACHE_MIDDLEWARE_KEY_PREFIX=getattr(properties, 'cache_prefix', 'cache_prefix')
CACHE_MIDDLEWARE_SECONDS=getattr(properties, 'cache_seconds', 5)
SESSION_BACKEND=getattr(properties, 'session_backend','django.contrib.sessions.backends.file')
if DEBUG:
    SESSION_EXPIRE_AT_BROWSER_CLOSE=True
SECRET_KEY = getattr(properties, 'secret_key','secret-key')
# -----------------------------------------------------------------------------
# templates
# -----------------------------------------------------------------------------
TEMPLATE_DIRS = getattr(properties, 'template_dirs', ('templates',))
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

TEMPLATE_CONTEXT_PROCESSORS=("django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request")

# -----------------------------------------------------------------------------
# Idiomatización
# -----------------------------------------------------------------------------
LANGUAGES = getattr(properties,'languages', ())
TIME_ZONE = getattr(properties,'time_zone', 'Europe/Madrid')
LANGUAGE_CODE = getattr(properties, 'language_code', 'en-en')
SITE_ID = getattr(properties, 'site_id', 1)
USE_I18N = getattr(properties,'use_i18n', True)
# -----------------------------------------------------------------------------
# Apps
# -----------------------------------------------------------------------------
INSTALLED_APPS = (
    'django.contrib.auth',
	'django.contrib.contenttypes',
	'django.contrib.sessions',
	'django.contrib.humanize',
	'django.contrib.sites',
	'django.contrib.admin',
)
# -----------------------------------------------------------------------------
# Middleware
# -----------------------------------------------------------------------------
MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.gzip.GZipMiddleware',
)
# -----------------------------------------------------------------------------
# Copyright
# -----------------------------------------------------------------------------
COPYRIGHT=getattr(properties,'copyright', True)